Real Numbers. 
                    The Archimedes approach
                      reinforced with Mathematica

© Evgenii M. Vorob'ev, 2011

Preface

The Archimedes method for calculating π is well known. Archimedes considered the sequences of semiperimeters of inscribed and circumscribed regular polygons. Denote the sequences of semiperimeters with {(Subscript[a, n])} and {(Subscript[b, n])}, where n is the number of polygon sides. For the unit circle,

(Subscript[a, n]) = n sin(π/n),  (Subscript[b, n]) = n tan(π/n).

Archimedes started with n = 3. Then he doubled the number of sides at each step unless he reached n = 96 after 6 steps. We can illustrate the Archimedes considerations with the following demonstration:

ArchimedesPi[StepsNumber[6]]

We see that the circle lies inbetween the polygons and that the polygons with side numbers 48 and 96 do not visually differ from the circle. Archimedes supposed that the length L  of the circle satisfies the inequalities
                                              2 (Subscript[a, n]) < L <  2 (Subscript[b, n]),
so
                                               (Subscript[a, n]) < π <  (Subscript[b, n]).

Note that Archimedes did not give the definition of the length of the circle regarding apparently it as obvious. Then by using the recurrent relations
                              (Subscript[a, 2n]) = (Subscript[a, n]) (Sqrt[((2 (Subscript[b, n]))/((Subscript[a, n]) + (Subscript[b, n])))]),     (Subscript[b, 2n]) =  2(((Subscript[a, n])(Subscript[b, n]))/((Subscript[a, n]) + (Subscript[b, n]))),       (1)

easily obtained from the trigonometric identities, he received that 

                              (Subscript[a, 96]) ≈ (223/71),      (Subscript[b, 96]) ≈ (22/7).

The average of (Subscript[a, 96]) and (Subscript[b, 96]) equals 3.14185. This gives π with the relative error less than 0.01%.

It is suprising that Archimedes obtained the approximate value of π but he had no clear idea of the real numbers. In his time, real numbers were no more than irrational numbers, i.e. numbers not represented by fractions p/q. Presumably, Archimedes considered {(Subscript[a, n])} and {(Subscript[b, n])} as infinite sequences of approximate values of π.

From our point of view, the Archimedean pair ({(Subscript[a, n])}, {(Subscript[b, n])}) is, in fact, the number π itself. The extension of this treatment to all real numbers is our aim. We would like to consider real numbers as appropriately defined Archimedean pairs of rational sequences.

Problem. Try to repeat the Archimedes number π calculation

Problem. Simulate the Archimedes calculation with Mathematica. For this, design a recurcive program calculating a[n], b[n], n = 3,6, 12, ... in accordance with (1).

Archimedes probably calculated the following rational approximations for (Sqrt[3])

                                    (265/153) < (Sqrt[3]) < (1351/780).

Use them when determining a[3], b[3].

Hint. Make rationalization of irrational numbers with Mathematica function Rationalize[x, dx].

The Pifagorean number (Sqrt[2])

The following result was one of the reasons to introduce irrational numbers into mathematics.

Pythagorean theorem. There is no rational number  p / q  such that its square equals 2.

The theorem means, in particular, that the graph of the function  (x^2)-2  does not intersect the x-axis of the rational coordinate plane, as there is no tick of (Sqrt[ 2]) on the rational axis. Pythagorean theorem can also be formulated as a statement of incommensurability of the diagonal and the sides of the square.

Thus, the rational numbers are not enough to provide the lengths of all of the segments and coordinates of all of the points of intersections of curves in the Euclidean plane.

Let us  give the definition of (Sqrt[2]) with the help of a pair of rational sequences. The idea of the definition is suggested by the measurement procedure of the segments.

Construct two sequences of rational numbers {(Subscript[a, n])} and {(Subscript[b, n])} such that the sequences {((Subscript[a, n])^2)} and {((Subscript[b, n])^2)} converge to 2. To do this, we set (Subscript[a, 1]) = 1, (Subscript[b, 1]) = 2. The inequalities ((Subscript[a, 1])^2) < 2 < ((Subscript[b, 1])^2) are valid.

Consider the table in the first row of which there are numbers from 1 to 2 in increments
of 0.1, while the second row consists of the squares of these numbers:

Radical[Degree[2],Approximations[1,2]]

Choose two adjacent numbers such that the square of the first  is smaller while the square of the second is more than two. In this case, they are 1.4 and 1.5. Let (Subscript[a, 2]) = 1.4,  (Subscript[b, 2]) = 1.5 . We have the inequalities  ((Subscript[a, 1])^2) < ((Subscript[a, 2])^2) < 2 < ((Subscript[b, 2])^2) < ((Subscript[b, 1])^2).

To construct (Subscript[a, 3]) and (Subscript[b, 3]), consider the table of squares of numbers from 1.4 to 1.5 in a step 0.01

Radical[Degree[2],Approximations[1.4,1.5]]

We see that  (1.41^2) < 2 < (1.42^2). Setting (Subscript[a, 3]) = 1.41 , (Subscript[b, 3]) = 1.42 , we arrive at the inequalities ((Subscript[a, 1])^2) < ((Subscript[a, 2])^2) < ((Subscript[a, 3])^2) <2 < ((Subscript[b, 3])^2) < ((Subscript[b, 2])^2) < ((Subscript[b, 1])^2).

Now consider the numbers from 1.41 to 1.42 with an interval  0.001 and select two neighbors following the same criteria. Continuing the described process, we obtain two sequences {(Subscript[a, n])} and {(Subscript[b, n])} with the following properties. 
                1. The sequence {(Subscript[a, n])} increases monotonically,  the sequence {(Subscript[b, n])} decreases
                     monotonically.
                2. For all indices  i, j  the inequalities (Subscript[a, i]) < (Subscript[b, j]) are valid.
                3.  (Subscript[b, n]) - (Subscript[a, n]) = (((0.1))^n).
                4. Rational sequences {((Subscript[a, n])^2)}  and {((Subscript[b, n])^2)} converge to 2.
                5. The sequences {(Subscript[a, n]) } and {(Subscript[b, n])} do not converge to any rational limit.

Pythagorean theorem and properties  4 and 5 indicate that the irrational number, denoted as (Sqrt[2]), could be naturally regarded as a pair of sequences ({(Subscript[a, n]) }, {(Subscript[b, n])}) of rational numbers.
They usually say that the elements of the sequence {(Subscript[a, n]) } provide the approximate values for (Sqrt[2]) with deficiency, and the elements of the sequence {(Subscript[b, n])} give them with excess.

We emphasize that  we consider (Sqrt[2]) not as the limit of the sequences {(Subscript[a, n]) } or {(Subscript[b, n])} but as a
designation or a common name of this pair of rational sequences.

Problems

Calculate the following radicals
              1. (2^(1/3))
              2. (3^(1/3))
              3. (5^(1/5))
              4. (7^(1/7))
              5. (11^(1/11))

within an accuracy (10^(-6)).

Number e-the base of the natural  logarithms

We define the real number, which is called the base of the natural logarithms and denoted
with e.

Consider two rational sequences {(Subscript[a, n])} and {(Subscript[b, n])}, the elements of which are given by the relations:

                        (Subscript[a, n]) = (1 + ((1/n))^n),         (Subscript[b, n]) = (1+ ((1/n ))^(n+1))

The following figure represents the first 40 elements of the sequences.

Clear[a,b];
a[n_]:=(((1+1/n))^n);b[n_]:=(((1+1/n))^(n+1));
GraphSequence[{a[n],b[n]},{n,1,40}]

Theorem. The sequences {(Subscript[a, n])} and {(Subscript[b, n])} have the following properties:
           1. The sequence {(Subscript[a, n])} increases monotonically and 3  is its upper bound.
           2. The sequence {(Subscript[b, n])} decreases monotonically.
           3. For all i, j the inequalities (Subscript[a, i]) < (Subscript[b, j]) are valid.
           4. The difference of the sequences {(Subscript[a, n])} and {(Subscript[b, n])} is an infinitesimal sequence.
           5. The inequality
                                  (Subscript[b, n]) -  (Subscript[a, n]) < (3/n)  (2)
                holds true.

We declare that the pair ({(Subscript[a, n])}, {(Subscript[b, n])})  of rational sequences is a real number denoted by e.

Archimedean number π

In order to calculate the pair ({(Subscript[a, n])}, {(Subscript[b, n])}) of rational sequences for number π, consider the rational sequence {(Subscript[c, n])} proposed by Gregory and Leibniz:
                 
                           (Subscript[c, n]) = 4 (1- (1/3)+ (1/5)- (1/7)+ ... + ((((-1))^(n-1))/(2n-1)))

The elements of the sequence are obtained from the MacLaurin serires for arctan[x] at the point x = 1.

The graph of {(Subscript[c, n])} is depicted at the following figure

Clear[c];c[n_]:=4 (∑_(k=1)^n)((((-1))^(k-1))/(2k-1));
GraphSequence[c[n],{n,1,50}]

The figure obtained demonstrates the fluctuating nature of the sequence. The elements with even indices  form a monotonically increasing subsequence {(Subscript[a, n])} of the sequence {(Subscript[c, n])}, and the elements with odd indices form a decreasing subsequence {(Subscript[b, n])}. Let us make the definitions of (Subscript[a, n]) and (Subscript[b, n]) and look at the graphs of the sequences

Clear[a,b];a[n_]:=c[2n];b[n_]:=c[2n-1];
GraphSequence[{a[n],b[n]},{n,1,40}]

The following formula for the difference between the elements of the sequences is valid

                                 (Subscript[b, n]) -(Subscript[a, n]) =  (4/(4n -1)).    (3)

Therefore, {(Subscript[b, n])- (Subscript[a, n])} is an infinitesimal sequence.

The pair of sequences ({(Subscript[a, n])}, {(Subscript[b, n])}) possesses the same properties, as the similar sequences, we have constructed to determine numbers (Sqrt[2]) and e in the preceding sections. Therefore, we can consider
number π as a pair of sequences ({(Subscript[a, n])}, {(Subscript[b, n])}).

Definition of real numbers

Based on the above examples, we give the general definition of the real number. For this, we note that  numbers (Sqrt[2]), e, π were associated  with the specific pairs of sequences. However, careful consideration of the principles of these sequences constructing reveals a certain arbitrariness admitted in their definition.

For example, when introducing  number (Sqrt[2]), we could undertake division into 100 parts, or into 2 parts, or into 5 parts, etc. instead of dividing the interval between the points (Subscript[a, n]), (Subscript[b, n]) into 10 parts. 
In the case of e, we could consider the sequences 
            (Subscript[u , n]) = (((1 + 1/(n^2)))^(n^2)),         (Subscript[v, n]) = (((1 + 1/(n^2)))^((n^2)+1))          
                   
etc. In this regard, we make the following definitions. 

Definition. Two rational sequences are called equivalent if their difference is an infinitesimal sequence. 

Definition. The real number α is  an equivalence class of the pairs ({(Subscript[a, n])}, {(Subscript[b, n])}) of rational sequences such that 
            1. The sequence {(Subscript[a, n])} is nondecreasing and the sequence {(Subscript[b, n])} is non-increasing.
            2. Each element  (Subscript[a, k]) is less than or equal to any element (Subscript[b, m]), i.e. for any natural  k, m  the
                inequality (Subscript[a, k])< (Subscript[b, m]) is true.
            3. The difference sequence {(Subscript[b, n])-(Subscript[a, n])} is an infinitesimal sequence.

Any pair ({(Subscript[a, n])}, {(Subscript[b, n])}) of equivalence class α is called  the representative of a real number α.

The pairs ({(Subscript[a, n])}, {(Subscript[b, n])}) of rational sequences satisfying properties 1 - 3  will be called   Archimedean pairs of sequences.

Note that if we consider the stationary  sequence {(Subscript[x, n])}, i.e. the sequence, all elements of which are equal to some rational number r , then the pair ({(Subscript[x, n])},{(Subscript[x, n])}) is Archimedean. The real number α represented by the couple under consideration can be identified with the rational number r.

In particular, number 0 is identified with the equivalence class the representative of
which is a couple ({(Subscript[u, n])}, {(Subscript[v, n])}) of stationary sequences such that (Subscript[u, n]) = (Subscript[v, n]) = 0  for all n.

The bisection method for calculating roots of polynomials with rational coefficiens is a natural source for the Archimedean pairs representing algebraic real numbers.

Example. Bisection method

Consider the polynomial (x^5)-x -1 having a unique real root at the interval (1, 3/2) as the following calculation demmonstrates.

x/.NSolve[(x^5)-x-1,x]

Run the following command.

Bisection[(x^5)-x-1,{x,1,3/2},20]

Calculation returns the first 20 elements of the sequences of the Archimedean pair for the real root in the fractional and decimal forms and the graphs of the obtained sequences.

Comparision of real numbers

Let the Archimedean pair ({(Subscript[a, n])}, {(Subscript[b, n])}) represent the real number α and ({(Subscript[u, n])}, {(Subscript[v, n])}) represent β.

Definition. The inequality α > β is valid iff there exists a number k such that 

                               (Subscript[a, k]) > (Subscript[v, k]).

The inequality α > β does not depend on the choce of representatives of α and of β.

It is clear that for any real numbers α, β either α > β or β > α.

From the definition, it follows that whatever the representative ({(Subscript[a, n])}, {(Subscript[b, n])})  of α we take, the following inequalities are valid:

                                (Subscript[a, k]) ≤ α ≤ (Subscript[b, k]),   k = 1,2, ...  (4)

Problem. Approximate values of e

Problem. Calculate e with an absolute error not exceeding (10^(-5)).

Solution. It follows from the inequality (2) that
                               (Subscript[b, n]) -  (Subscript[a, n]) < (10^(-5)) for n > 3×(10^5)

Therefore, we can make the calculation:

{a[3 (10^5)+1],b[3 (10^5)+1]}//N

The returned result means that
                  2.71828 < e < 2.71829

Problem. Approximate values for π

Problem. Calculate π with an absolute error not exceeding (10^(-4)).

Hint. Use the relation (3).

Decimal representation of real numbers

The Archimedean pair ({(Subscript[a, n])}, {(Subscript[b, n])}), representing number (Sqrt[2]),  satisfies the relation
(Subscript[b, n]) - (Subscript[a, n]) = 1 / (10^(n-1)). The Archimedean pairs for numbers e and π do not possess this property. We establish that  we can specify the Archimedean pair similar to the Archimedean pair for (Sqrt[2]) for any real number α.

We can associate two integer numbers with each rational number r. The number F (r)   
is  the largest integer such that F (r) ≤ r . It is called the floor of r. The number C (r) is the smallest integer such that  r <C (r). It is called the ceiling of r.

It is easy to see that F(p/q) equals the quotient of the integers p and q.

The existence of the floor and the ceiling for the irrational numbers follows from the 
inequalities (Subscript[a, k]) ≤ α ≤ (Subscript[b, k]),   k = 1,2, .... Indeed, they imply the relations

                                   F((Subscript[a, k])) ≤ α ≤ C((Subscript[b, k])),   k = 1,2, ...

So we should compare with α the finite number of integers that lie between F((Subscript[a, k])) and C((Subscript[b, k]))  in order to calculate F(α) and C(α).

Theorem. Let α be an irrational real number. Then  there exists  the Archimedean pair ({(Subscript[u, n])}, {(Subscript[v, n])}), representing α, such that {(Subscript[u, n])} and {(Subscript[v, n])} are sequences of finite decimal fractions with the following properties:
                1. The relations (Subscript[v, n])-(Subscript[u, n]) = 1 / (10^(n-1)) hold true.
                2. The sequence {(Subscript[u, n])} is nondecreasing and the sequence {(Subscript[v, n])} is non-increasing.
                3. For each k the inequalities (Subscript[u, k]) < α < (Subscript[v, k]) are valid.
                    Moreover, 
                   (Subscript[u, n])= ((F((10^(n-1))α))/(10^(n-1))),       (Subscript[v, n]) = ((C((10^(n-1))α))/(10^(n-1))).

Example. Decimal representation of e

Let us calculate the first three elements of the sequences  {(Subscript[u, n])} and {(Subscript[v, n])}. Start with the sequences {(Subscript[a, n])}, {(Subscript[b, n])} earlier introduced:

a[n_]:=(((1+1/n))^n); b[n_]:=(((1+1/n))^(n+1));

For obtaining (Subscript[u, 1]), we have to calculate F(e). We know that F((Subscript[a, k])) ≤ F(e) for all k. But F((Subscript[a, k])) may vary with k. Therefore, we need to find such a number N that F((Subscript[a, k])) is one and the same for all k > N. Then F(e) = F((Subscript[a, k])), k > N. Evidently, N can be found from the relation F((Subscript[a, N])) + 1 = C((Subscript[b, N])).

After running the command

{1}//.{n_}:>{n+1}/;Ceiling[b[n]]-Floor[a[n]]>1

returning that Ceiling[b[n]]-Floor[a[n]]<1 provided n ≥ 5  we get that

{u[1]=Floor[a[5]],v[1]=Ceiling[b[5]]}

This means that 2 < e < 3.

After the computation

{6}//.{n_}:>{n+1}/;Ceiling[10b[n]]-Floor[10a[n]]>1

returning that Ceiling[ 10 b[n]]-Floor[10 a[n]]<1 provided n ≥ 74 we can set

{u[2]=Floor[10a[74]]/10,v[2]=Ceiling[10b[74]]/10}

This means that 2.7 < e < 2.8. The last steps are the following

index=First[{75}//.{n_}:>{n+1}/;Ceiling[100b[n]]-Floor[100a[n]]>1];
{u[3]=Floor[100a[index]]/100,v[3]=Ceiling[100b[index]]/100}

This means that 2.71 < e < 2.72.

Generally speaking, we can continue our calculation until we obtain e within any desired accuracy. But it takes too much time, so this method of calculating approximations for e is of only theoretical interest.

Arithmetic operations

Let the Archimedean pair ({(Subscript[a, n])}, {(Subscript[b, n])}) represent the real number α and ({(Subscript[u, n])}, {(Subscript[v, n])}) represent β.

Addition. The Archimedean pair ({(Subscript[a, n])+ (Subscript[u, n])}, {(Subscript[b, n]) + (Subscript[v, n])}) is a representative of α + β.

Consider the Archimedean pair ({-(Subscript[v, n])}, {-(Subscript[u, n])}). It represents the number -β which is opposite to β.

Subtraction. By definition, α - β = α + (-β).

Multiplication. The Archimedean pair ({(Subscript[a, n])× (Subscript[u, n])}, {(Subscript[b, n]) × (Subscript[v, n])}) is a representative of α × β.

Consider the Archimedean pair ({1/(Subscript[v, n])}, {1/(Subscript[u, n])}). It represents the number 1/β which is reciprocal to β.

Division. By definition, α / β = α × (1/β).

Decimal representations and subtraction of real numbers yield the following statement.

Theorem. The set of rational numbers is a dense subset of the set of real numbers.

Completeness of the set of real numbers

The independence of comparision of real numbers and arithmetic operations on the choice of representatives of real numbers is the explanation of our definition of real numbers as equivalence classes. Each representative of the equivalence class is indistinguishable from another in terms of comparision and arithmetic operations.

We got the set of real numbers by adjoining the Archimedean pairs of rational sequences to the set of rational numbers. The question naturally arises whether we can get a new kind of numbers if we consider the Archimedean pairs of real sequences. The answer is negative.

Indeed, let us consider the equivalence class ℵ of Archimedean pairs ({(Subscript[α, n])},{(Subscript[β, n])}), where {(Subscript[α, n])} and {(Subscript[β, n])} are sequences of real numbers. In particular, there are Archimedean pairs ({(Subscript[a, n])},{(Subscript[b, n])}) of rational sequences in the equivalence class.

From a formal point of view, the equivalence class ℵ is a new mathematical object compared to a real number. But if we want to treat ℵ as a number, we must define a comparison and arithmetic operations over these objects. Since ℵ contains the Archimedean pairs of rational sequences, we have to repeat our definitions of the comparision and the arithmetic operations now w.r.t. these new objects.

As a result, the equivalence classes like ℵ becomes indistinuishable from real numbers. This fact establishes the following theorem.

Theorem. The set of real numbers is a complete set.

The idea of equivalence classes like ℵ is actually owned by Archimedes since the semiperimeters of inscribed and circumscribed poygons are irrational numbers except of the inscribed hexagon.

Real axis

Consider the directed straight line L. Fix an arbitrary point O and an arbitrary segment [a, b] on L. The point O is called the origin and [a, b] is called the scale segment. It is well known that we can mark any rational number on L. For this, we simply use O and [a,b] and axioms and theorems of the Euclidean geometry. Making the mark requires finite number of steps.

But the axioms of Euclid are not enough to mark an arbitrary irrational number. It is nesessary and sufficient to complete the Euclidean axioms with the following axiom.

Cantor's Axiom. Any embedded system of segments whose lengths tend to zero admits the only common point.

Cantor's Axiom adopted, marking any real number α is simple. We take the representative ({(Subscript[a, n])},{(Subscript[b, n])}) of α and mark the rational numbers (Subscript[a, n]) and (Subscript[b, n]), n = 1, 2, ... . The segments [(Subscript[a, n]), (Subscript[b, n])] satisfy the conditions of Cantor's Axiom and determine the point (Subscript[P, α]) which is the tick of α. Thus, any real number is marked with the point on L.

On the other hand, we can assosiate the real number with any point on L by using [a, b] and the standard theoretic measerment process.

Theorem. There is the one-to-one map from the set R of real numbers to the set of all the points on L.

Definition. The real axis is the set of all the points on a directed line L endowed with the origin O and the scale segment [a, b].

Since the set R of real numbers is complete, the real axis is also complete. Cantor's axiom expresses the completeness property of the real axis.

Cantor's axiom, in addition to allegations about the existence of a single common point, declares the possibility of infinite division of the axis segments. This property of the axis segments may be called the continuity of the real axis.

Cantor's Axiom may be called the axiom of completeness and continuity of the real axis.

Programs

<<"PlotLegends`"

Clear[GraphSequence];
SetAttributes[GraphSequence,HoldFirst];
GraphSequence[seq_/;Head[seq]=!=List,{var_,n_Integer,k_Integer,dvar_:1},lim_:{},opts___]:=Module[{l,pnt,data,p1,p2,p3,gr},dt=Table[{seq,0},{var,n,k}];l=Limit[seq,var->∞];inside=If[lim=!={},Select[dt,First[lim]≤First[#1]≤Last[lim]&]];outside=If[lim=!={},Select[dt,First[#1]<First[lim]||First[#1]>Last[lim]&]];pnt=If[NumericQ[l],Graphics[{PointSize[0.0001`],Point[{n,l}]}],Graphics[{}]];data=Table[{var,seq},{var,n,k,dvar}];p1=ListPlot[data,PlotStyle->{Hue[0.`],PointSize[0.01`]},DisplayFunction->Identity];p2=ListPlot[data,PlotStyle->{Hue[0.3`]},Joined->True,DisplayFunction->Identity];p3:=Plot[{First[lim],Last[lim]},{var,n,k},PlotStyle->{Dashing[{0.02`,0.02`}]},DisplayFunction->Identity];gr:=If[lim=!={},Print[Style[Row[{"Номера элементов вне  ",{First[lim],Last[lim]}," = ",Flatten[(Position[dt,#1]&)/@outside]+n-1,",","\nНомера элементов внутри ",{First[lim],Last[lim]},"= ",Flatten[(Position[dt,#1]&)/@inside]+n-1}],"Output",Background->GrayLevel[0.9`],FontSize->14,Black]];ShowLegend[Show[p2,p1,p3,pnt,PlotRange->All,Background->GrayLevel[0.95`],ImageSize->{560,400},DisplayFunction->Identity,BaseStyle->{16,FontFamily->"BoldCourier"}],{{{Graphics[{Hue[0],PointSize[0.2`],Point[{0,0}]}],Style["sequence elements",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]},{Graphics[{Black,Dashing[{0.2`,0.2`}],Line[{{0,0},{3,0}}]}],Style["boundaries",FontSize->12,Black]},{Graphics[{Hue[0.3`],Line[{{0,0},{3,0}}]}],Style["auxiliary line",FontSize->12,Black]}},LegendPosition->{-1.`,-1.`},LegendSize->{1.3`,0.25`},LegendBackground->GrayLevel[0.9`],LegendTextOffset->{-0.8`,0}}],ShowLegend[Show[p2,p1,pnt,PlotRange->All,Background->GrayLevel[0.9`],ImageSize->{560,400},DisplayFunction->Identity,BaseStyle->{16,FontFamily->"BoldCourier"}],{{{Graphics[{Hue[0],PointSize[0.15`],Point[{0,0}]}],Style["sequence elements",FontFamily->"Courier",FontSize->14,FontWeight->"Bold",Black]},{Graphics[{Hue[0.3`],Line[{{0,0},{1.5`,0}}]}],Style["auxiliary line",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]}},LegendPosition->{-1.`,-1.`},LegendSize->{1.3`,0.25`},LegendBackground->GrayLevel[0.85`],LegendTextOffset->{-0.7`,0}}]];gr];
GraphSequence[seq_List/;Length[seq]==2,{n_,k_Integer,m_Integer}]:=Module[{(*d1,d2,p1,p2*)},d1=Table[{n,First[seq]},{n,k,m}];d2=Table[{n,Last[seq]},{n,k,m}];p1=ListPlot[d1,PlotStyle->{Hue[0],PointSize[0.01`]}];pp1=ListPlot[d1,PlotStyle->{Hue[0.3],Thickness[0.001`]},Joined->True];p2=ListPlot[d2,PlotStyle->{PointSize[0.01`],Hue[0.7`]}];
pp2=ListPlot[d2,PlotStyle->{Thickness[0.001`],Hue[0.3]},Joined->True];ShowLegend[Show[pp1,pp2,p1,p2,PlotRange->All,Axes->True,ImageSize->{560,400},Background->GrayLevel[0.9`],BaseStyle->{16,FontFamily->"BoldCourier"}],{{{Graphics[{Hue[0],PointSize[0.17`],Point[{0,0}]}],Style["elements of the first sequence",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]},{Graphics[{Hue[0.7`],PointSize[0.17`],Point[{0,0}]}],Style["elements of the second sequence",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]},{Graphics[{Hue[0.3`],Line[{{0,0},{2.,0}}]}],Style["auxiliary lines",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]}},LegendPosition->{-1`,-1},LegendSize->{1.4,0.25`},LegendBackground->GrayLevel[0.85`],LegendTextOffset->{-0.7`,0}}]]
GraphSequence[seq_List/;Length[seq]==2,{n_,k_Integer,m_Integer},{a_,b_}]:=Module[{(*d1,d2,p1,p2*)},d1=Table[{n,First[seq]},{n,k,m}];d2=Table[{n,Last[seq]},{n,k,m}];p1=ListPlot[d1,PlotStyle->{Hue[0],PointSize[0.01`]}];pp1=ListPlot[d1,PlotStyle->{Hue[0.3],Thickness[0.001`]},Joined->True];p2=ListPlot[d2,PlotStyle->{PointSize[0.01`],Hue[0.7`]}];
pp2=ListPlot[d2,PlotStyle->{Thickness[0.001`],Hue[0.3]},Joined->True];
p3=Plot[{a,b},{n,k,m},PlotStyle->{Dashing[{0.02,0.02}]}];
ShowLegend[Show[pp1,pp2,p1,p2,p3,PlotRange->All,Axes->True,ImageSize->{560,400},Background->GrayLevel[0.9`],BaseStyle->{16,FontFamily->"BoldCourier"}],{{{Graphics[{Hue[0],PointSize[0.17`],Point[{0,0}]}],Style["elements of the first sequence",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]},{Graphics[{Hue[0.7`],PointSize[0.17`],Point[{0,0}]}],Style["elements of the second sequence",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]},{Graphics[{Hue[0.3`],Line[{{0,0},{2.,0}}]}],Style["auxiliary lines",FontFamily->"Courier",FontSize->12,FontWeight->"Bold",Black]}},LegendPosition->{-1`,-1},LegendSize->{1.4,0.25`},LegendBackground->GrayLevel[0.85`],LegendTextOffset->{-0.7`,0}}]]

RegularPolygonIns[n_]:=Graphics[{Green,Thickness[0.007],Line[Table[{Cos[((4Pi k)/(3 (2^n)))],Sin[((4Pi k)/(3 (2^n)))]},{k,0,3 (2^n)}]]}]

RegularPolygonCirc[n_]:=Graphics[{Red,Thickness[0.007],Line[Table[(1/(Cos[(π/(3 (2^(n-1))))])){Cos[((π(2 k+1))/(3 (2^(n-1))))],Sin[((π(2 k+1))/(3 (2^(n-1))))]},{k,0,3 (2^(n-1))}]]}]

ArchimedesPi[StepsNumber[n_]]:=Manipulate[Show[Graphics[{Thickness[0.009],Circle[{0,0},1],Point[{0,0}]},AspectRatio->Automatic],RegularPolygonIns[k],RegularPolygonCirc[k],PlotRange->{{-Sec[π/3],Sec[π/3]},{-Sec[π/3],Sec[π/3]}},AspectRatio->1.2],{k,1,n,1}]

Radical[Degree[k_],Approximations[a_,b_]]:=Module[{step},step=(b-a)/10;Style[Transpose[Table[{NumberForm[N[a+j step],8],NumberForm[N[(((a+j step))^k)],8]},{j,0,10}]]//TableForm,Bold]]

Bisection[expr_,{z_,a_,b_},n_]:=Module[{step,data},
step[ex_,l_]:=l/.{{u_,x_,y_}:>{u,(x+y)/2,y}/;((ex/.u->x)(ex/.u->(x+y)/2))>0,{u_,x_,y_}:>{u,x,(x+y)/2}/;((ex/.u->x)(ex/.u->(x+y)/2))<0};
data=Transpose[Delete[#,1]&/@NestList[step[expr,#]&,{z,a,b},n]];
Print[data];Print[data//N];
ListPlot[data,ImageSize->{500,400},PlotRange->All]]
Bisection[(x^5)-x-1,{x,1,3/2},10]